Telegram Group & Telegram Channel
Как преобразовать строку в число с плавающей запятой, если в строке есть лишние запятые (ч.2)

Преобразовать такую строку в число с плавающей запятой сложнее. Вызов функции float() напрямую приведет нас к ошибке. Поэтому, прежде чем вызвать функцию float(), нам нужно избавиться от лишней запятой в строке.

Запятую мы удалим из строки с помощью функции replace(), заменив ее на пустую строку..



tg-me.com/pythonist24/1493
Create:
Last Update:

Как преобразовать строку в число с плавающей запятой, если в строке есть лишние запятые (ч.2)

Преобразовать такую строку в число с плавающей запятой сложнее. Вызов функции float() напрямую приведет нас к ошибке. Поэтому, прежде чем вызвать функцию float(), нам нужно избавиться от лишней запятой в строке.

Запятую мы удалим из строки с помощью функции replace(), заменив ее на пустую строку..

BY Python обучающий




Share with your friend now:
tg-me.com/pythonist24/1493

View MORE
Open in Telegram


Python обучающий Telegram | DID YOU KNOW?

Date: |

The Singapore stock market has alternated between positive and negative finishes through the last five trading days since the end of the two-day winning streak in which it had added more than a dozen points or 0.4 percent. The Straits Times Index now sits just above the 3,060-point plateau and it's likely to see a narrow trading range on Monday.

Newly uncovered hack campaign in Telegram

The campaign, which security firm Check Point has named Rampant Kitten, comprises two main components, one for Windows and the other for Android. Rampant Kitten’s objective is to steal Telegram messages, passwords, and two-factor authentication codes sent by SMS and then also take screenshots and record sounds within earshot of an infected phone, the researchers said in a post published on Friday.

Python обучающий from sg


Telegram Python обучающий
FROM USA